const mongoose = require('mongoose')

const schema = new mongoose.Schema({
    username:{
        type: String,
        require: true,
        unique:true
    },
    password:{
        type: String,
        require: true,
        select: false
    },
    control:{
        type: String,
    },
    todoList:{
        start:[],
        running:[],
        finished:[]
    },
    collectArticle:[{
        type: mongoose.SchemaTypes.ObjectId,
        ref: 'Article'
    }],
    collectDesign:[{
        type: mongoose.SchemaTypes.ObjectId,
        ref: 'Design'
    }],
    attention:[{
        type: mongoose.SchemaTypes.ObjectId,
        ref: 'User'
    }],
    navList:[{
        name: String,
        address: String
    }],
    searchEngine:{
        type: String
    },
    touxiang:{
        type: String,
        default: '/upload/touxiang1.png'
    }
})

module.exports = mongoose.model('User', schema)